package cn.coldleaf.wiki.utils;

/**
 * 定义错误码
 * @datetime 2023-10-15 13:42:04
 * @user cold
 **/
public enum ErrorCode {
    SUCCESS(0,"操作成功"),
    PARAM_ERROR(91,"参数错误"),
    AUTH_ERROR(90,"权限错误"),
    EXCEPTION(99,"操作异常"),
    LOGIN_ERROR(1,"登录失败"),
    CAPTCHA_ERROR(2,"验证码错误"),
    USER_EXISTS_ERROR(3,"用户名已存在"),
    USER_INFO_ERROR(4,"获取用户信息失败"),
    USER_SAVE_ERROR(5,"创建用户失败"),
    USER_NOT_EXISTS_ERROR(6,"用户不存在"),
    USER_MODIFY_ERROR(7,"修改用户信息失败"),
    USER_MODIFY_PWD_ERROR(8,"修改用户密码失败"),
    USER_RESET_PWD_ERROR(9,"重置用户密码失败"),
    USER_CREATE_ERROR(10,"创建用户失败"),
    USER_UPDATE_ERROR(11,"修改用户失败"),
    FILE_UPLOAD_ERROR(12,"上传文件失败"),
    SPACE_SAVE_ERROR(20,"创建空间失败"),
    SPACE_MODIFY_ERROR(21,"修改空间失败"),
    SPACE_REMOVE_ERROR(22,"删除空间失败"),
    SPACE_NOT_EXISTS_ERROR(23,"空间不存在"),
    DOC_SAVE_ERROR(30,"创建文档失败"),
    DOC_MODIFY_ERROR(31,"修改文档失败"),
    DOC_REMOVE_ERROR(32,"删除文档失败"),
    DOC_NOT_EXISTS_ERROR(33,"文档不存在"),
    ;
    private ErrorCode(int code,String msg){
        this.code = code;
        this.msg = msg;
    }
    private final int code;
    private final String msg;

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
